#ifndef SERVER_H_INCLUDED
#define SERVER_H_INCLUDED

#include "md5.h"
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <string.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>


class server
{
public:
    server();
    void server_startup();
    unsigned short port;
    static string result;
private:
    static void* md5_thread(void*);
    static void* accept_client(void*);
    static void* pthread_md5_thread(void*);
    static void* pthread_accept_client(void*);
    int read_conf();
    void printlog(string&);

    struct sockaddr_in server_addr, client_addr;
    int server_fd, client_fd;
};



#endif // SERVER_H_INCLUDED
